﻿@model Tuple<PracticeAzure.Website.Data.Corrigendum, IEnumerable<PracticeAzure.Website.Data.CorrigendumAttachment>>

@*
this template must be nested in a <table> element
*@

<tr>
    <td style="width: 10%; background-color: rgb(239, 240, 243); font-size: 0.8em; vertical-align: top;">
        <div style="text-align: center;">
            <div class="avatar">
                <img src="/Content/shaun.jpg" alt="Shaun's Avatar" />
            </div>
            <div class="datetime">
                @Model.Item1.UpdatedOn.ToString()
            </div>
        </div>
    </td>
    <td style="background-color: rgb(239, 240, 243);">
        <div class="reply-action-top" style="margin: 0px 0px 10px 0px; padding: 0px 0px 2px 0px; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #aaaaaa;">
            <div class="reply-action" style="text-align: right;">
                @if (PracticeAzure.Website.Shared.GlobalConfiguration.AllowReply)
                { 
                    <a href="#reply-box" class="reply-action" id="reply-action-root">回复</a>
                }
                @if (User.Identity.IsAuthenticated)
                {
                    <text> | </text>@Html.ActionLink("修改", "Edit", new { id = Model.Item1.ID })
                    <text> | </text>@Html.ActionLink("删除", "Delete", new { id = Model.Item1.ID })
                }
            </div>
        </div>
        <div class="corrigendum-body" id="corrigendum-body">
            @Model.Item1.RenderedBody
        </div>
        <div class="attachments" style="margin: 20px 0px 0px 0px;">
            @if (Model.Item2.Any())
            { 
                <fieldset>
                    <legend>附件</legend>
                        @foreach (var attechment in Model.Item2)
                        {
                            <span style="display: block; margin: 2px 0px 0px 2px;">
                                + <a href='@Html.Raw(attechment.URL)' style="border-style: none;">@attechment.URL</a> （上传于 @attechment.CreatedOn.ToString()）
                            </span>
                        }
                </fieldset>
            }
        </div>
    </td>
</tr>
